Skip to content

Conversation

@thecraftianman
Copy link
Contributor

Just a couple more string library tests I wrote up real quick while testing.

Copy link
Member

@sarahsturgeon sarahsturgeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of updates to the expected err message! 🙏

@thecraftianman
Copy link
Contributor Author

Should be good now

Copy link
Member

@sarahsturgeon sarahsturgeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last thing 🙏

@sarahsturgeon
Copy link
Member

Weird batch of errors on the latest run, dunno why it's doing that

@thecraftianman
Copy link
Contributor Author

Yeah that's really strange. I don't think there's anything else wrong with the test cases themselves as far as I can tell. Does it still do that even if the tests are run again?

@sarahsturgeon
Copy link
Member

I think the error message just says ? instead of Left/Right - idk why it does that but it's probably a simple fix

@thecraftianman
Copy link
Contributor Author

Anything else I should do for this on my end? Changing the expected error messages to have ? doesn't really seem right considering that's not the error that actually shows up in-game.

Copy link
Collaborator

@RaphaelIT7 RaphaelIT7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good :D
the current issues with the error messages showing '?' are because of GLuaTest failing in your special case, in all other tests the errWith calls are not given directly the function that will error, instead they are are either wrapped in something like local testFunc = function(...) yourFunction(...) end or the error is thrown inside the function by another function that it uses inside of it.
In your case, you give expect directly to the function that throws the error, like string.Left with the nil argument, which hasn't been done before apparently and causes the error message to contain '?' as Lua loses track of the function you passed that is then called by pcall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants